var axiosget = function (url, param, succ) {
    axios.get(url, {params: param})
        .then(function (response) {
            console.info(response)
            if(response.data.code == 200){
                succ(response.data)
            }else{
                $.toast("服务器错误，"+reponse.data.msg, "forbidden");
            }
        })
        .catch(function (error) {
            $.toast("服务器未找到", "forbidden");
        });
};

var axiospost = function (url, param, succ) {
    axios.post(url, param)
        .then(function (response) {
            console.info(response)
            if(response.data.code == 200){
                succ(response.data)
            }else{
                $.toast("服务器错误，"+reponse.data.msg, "forbidden");
            }
        })
        .catch(function (error) {
            $.toast("服务器未找到", "forbidden");
        });
};

var axiosconfig = function (conf) {
    axios({
        url: conf.url,
        method: conf.method,
        params: conf.params,
        data: conf.data,
        timeout: 1000,
        auth: conf.authorization,
        maxContentLength: 2000
    }).then(function (response) {
        console.info(response)
        if(response.data.code == 200){
            toastr.success('操作成功', 'successful');
            conf.succ(response.data)
        }else{
            toastr.error("服务器错误，"+response.data.msg, 'error');
        }
    })
    .catch(function (error) {
        toastr.error("服务器未找到", 'error');
    });
}